
from django.shortcuts import render
from django.views import View
from django.http import JsonResponse
# Create your views here.

class Index(View):
    def get(self,request):
        # 不分离
        # return render(request,'index.html',context={'name':'itcast'})

        return JsonResponse({'name':'itcast'})



class Login(View):
    def get(self,request):
        # 不分离
        # return render(request,'index.html',context={'name':'itcast'})

        return JsonResponse({'message':'ok'})

class Book(View):

    def get(self,request,id):
        # 根据id查询图书

        # if version==0.1:
        #
        # elif version==0.2:

        return JsonResponse({'btitle':'西游记'})
